]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
bluetooth: Fix showing menu when devices were set up
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 3 Apr 2020 12:34:21 +0000 (14:34 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 7 Apr 2020 13:44:50 +0000 (15:44 +0200)
Since commit 26c2cb9f65c, nDevices is always the actual number of
paired/trusted devices. So when bluetooth is turned off, it is
now 0 rather than forced to 1 if devices were set up previously.

Fix this by checking the property that tracks set up devices instead.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1174

js/ui/status/bluetooth.js

index 04a6d5ae294eadfbad51727f680dee81ce2930a8..0c43749feec1d17644dccc7c20bf5cddc3e075c9 100644 (file)
@@ -109,7 +109,6 @@ class Indicator extends PanelMenu.SystemIndicator {
         let devices = this._getDeviceInfos(adapter);
         const connectedDevices = devices.filter(dev => dev.connected);
         const nConnectedDevices = connectedDevices.length;
-        const nDevices = devices.length;
 
         let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
 
@@ -118,7 +117,7 @@ class Indicator extends PanelMenu.SystemIndicator {
 
         // Remember if there were setup devices and show the menu
         // if we've seen setup devices and we're not hard blocked
-        if (nDevices > 0)
+        if (this._hadSetupDevices)
             this._item.visible = !this._proxy.BluetoothHardwareAirplaneMode;
         else
             this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;